<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>来吧我们也抢票吧</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <style>
        .hidden-on{
            display: none;
        }
    </style>
</head>
<body>
<form>
    <div>
        <img style="margin-left: 50px;margin-top: 20px;" id="codeImg" width="293px" height="139px" src="pass_code.jpeg">
    </div>
    <div>
        <input type="text" value="" id="checkCode" name="checkCode">
        <span onclick="submitCode();">提交</span>
        <span onclick="reflashCode();">刷新</span>
    </div>

</form>
</body>
<script>

    function reflashCode() {
        window.location.href = '/reflash'
    }

    function submitCode() {
        var code = $('#checkCode').val();
        if(code){
            codeArr = [];
            for(var i =0;i<code.length;i++){
                switch(code[i]){
                    case "1":
                        codeArr.push("37,50");
                        break;
                    case "2":
                        codeArr.push("105,50");
                        break;
                    case "3":
                        codeArr.push("180,50");
                        break;
                    case "4":
                        codeArr.push("260,50");
                        break;
                    case "5":
                        codeArr.push("37,115");
                        break;
                    case "6":
                        codeArr.push("105,115");
                        break;
                    case "7":
                        codeArr.push("180,115");
                        break;
                    case "8":
                        codeArr.push("260,115");
                        break;
                    default:
                        break;
                }
            }
            codeStr = codeArr.join(",");
            window.location.href = "/subCode?code="+codeStr;
        }
    }

</script>
</html>